<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class ssq extends Model
{
    //关联数据表
    public $table = 'ssq_openlist';

    //主键
    public $primaryKey = "id";

    //允许操作的字段
    public $fillable = ['number','number1','qihao','time','no1num','no2num','no3num','no4num','no5num','no6num','no1money','no2money','no3money','no4money','no5money','no6money','xiaoshou','jiangchi','no1msg'];

    //不允许操作的字段
//    public $guarded=[];

    //是否维护crated_at和updated_at字段
    public $timestamps = true;

    //获取最后一期的期号
    public function getLastQh(){
        return $this->select('qihao','number','no1num','no1money','no1msg','no2money','time','flag')->orderBy('qihao','DESC')->limit(1)->first();
    }
}
